package co.yixiang.common.log.service;

import co.yixiang.upms.common.logging.domain.Log;
import co.yixiang.upms.common.logging.feign.RemoteLoggingService;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 异步调用日志
 */
@Service
public class AsyncLogService {

    private final RemoteLoggingService logService;

    public AsyncLogService(RemoteLoggingService logService) {
        this.logService = logService;
    }

    /**
     * 保存系统日志记录
     */
    @Async
    public void saveSysLog(Log log)
    {
        logService.save(log);
    }
}
